package com.zc.demo.springframework;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 打印接口
 * Created by zhangchi9 on 2016/11/2.
 */
@Component
public class MessagePrinter {
    final private MessageService messageService;

    @Autowired
    public MessagePrinter(MessageService messageService){
        this.messageService = messageService;
    }

    public void printMessage(){
        System.out.println(this.messageService.getMessage());
    }
}
